<script type="text/javascript" src="{$smarty.const.URL_JS}/category.js"></script>
<link type="text/css" rel="stylesheet" href="{$smarty.const.URL_CSS}/blue/style.css" />
{* category view *}
{*
<div class="clearfix" id="cat_path">
<table cellpadding="0" border="0" class="cat_path_in_productpage">
	<tr>
	{if $selected_category.picture}
	<td><img src="{$smarty.const.URL_PRODUCTS_PICTURES}/{$selected_category.picture|escape:'url'}" alt="{$selected_category.name|escape:'html'}" title="{$selected_category.name|escape:'html'}" >
	</td>
	{/if}
	<td><a href="{"?"|set_query}">{"lnk_homepage"|translate}</a>&nbsp;{$BREADCRUMB_DELIMITER}
		{section name=i loop=$product_category_path}
		{if $product_category_path[i].categoryID != 1}
		<a href='{"?categoryID=`$product_category_path[i].categoryID`&category_slug=`$product_category_path[i].slug`"|set_query_html}'>{$product_category_path[i].name|escape:'html'|default:"(no name)"}</a>{if !$smarty.section.i.last}&nbsp;{$BREADCRUMB_DELIMITER}{/if}
		{/if}
		{/section}
	</td>
	</tr>
	</table>
</div>
*}
	
	<div class="clearfix" id="cat_top_tree">
{*
@features "Search products by params"
*}
		{if $allow_products_search}
		{* include file="advanced_search_in_category.tpl.html" *}
		{/if}
{*
@features
*}
		
		<div id="cat_info_left_block">
		{* description *}
		{$selected_category.description}

		{*
		{if $subcategories_to_be_shown}		
		* show subcategories *
		<p>{section name=i loop=$subcategories_to_be_shown}
		{if $subcategories_to_be_shown[i][3]}
			{assign var=_sub_category_url value="?categoryID=`$subcategories_to_be_shown[i][0]`&category_slug=`$subcategories_to_be_shown[i][3]`"|set_query_html}
		{else}
		{assign var=_sub_category_url value="?categoryID=`$subcategories_to_be_shown[i][0]`"|set_query_html}
		{/if}
		 <a href="{$_sub_category_url}">{$subcategories_to_be_shown[i][1]}</a>
		 ({$subcategories_to_be_shown[i][2]})<br>
		{/section}</p>
		{/if}
		*}
		</div>

</div>

<center>
{if $products_to_show}

{*
 * @features "Products comparison"
*}
{include file="comparison_products_button.html"}
{*
 * @features
*}


{* if $string_product_sort}<p id="cat_product_sort">{$string_product_sort}</p>{/if *}


{* {if $catalog_navigator}<p>{$catalog_navigator}</p>{/if} *}
	
<h1 class="m100">{$selected_category.name|escape:'html'}</h1>

<table id="tablesorter" class="tablesorter" >
<thead>
<tr>
	<th></th>
	<th>Наименование</th>
	<th>Код</th>
	<th>В упаковке </th>
	<th><p>Цена</p></th>
	<th width="110">Количество</th>
</tr>
</thead>
<tbody>
  {foreach from=$products_to_show item=product_item name=product_brief}
	{* if $smarty.foreach.product_brief.index is div by $smarty.const.CONF_COLUMNS_PER_PAGE}<tr>{/if *}
	
	{if $product_item.slug}
	{assign var=_product_url value="?ukey=product&productID=`$product_item.productID`&product_slug=`$product_item.slug`"|set_query_html}
	{else}
	{assign var=_product_url value="?ukey=product&productID=`$product_item.productID`"|set_query_html}
	{/if}
	{if $widget}{assign var=_form_action_url value="&view=noframe&external=1"}{/if}
	
	{if $smarty.foreach.product_brief.index is div by 2}
		{assign var=classodd value="odd"}
	{else}
		{assign var=classodd value="even"}
	{/if}
	
	{*
	<td class="{$classodd}" valign="top" width="{math equation="100 / x" x=$smarty.const.CONF_COLUMNS_PER_PAGE format="%d%%"}">
		{
		include file="product_brief.html" product_info=$product_item 
		}		
	</td>
	*}
	
<!-- tr product block -->
	<tr>
		<td>
		{if $product_item.thumbnail || $product_item.picture}
		<div class="price_img">
		<table cellpadding="0" cellspacing="0">
			<tr>
				<td align="center" valign="middle" style="width: {$smarty.const.CONF_PRDPICT_THUMBNAIL_SIZE}px; height: {$smarty.const.CONF_PRDPICT_THUMBNAIL_SIZE}px;">
					<!-- Thumbnail -->
					<a {$target} href='{$_product_url}'>
					<div class="ribbon"></div>
	{if $product_item.thumbnail}
						<img src="{$smarty.const.URL_PRODUCTS_PICTURES}/{$product_item.thumbnail|escape:'url'}" alt="{$product_item.name|escape:'html'}" title="{$product_item.name|escape:'html'}">											
	{elseif $product_item.picture}
						<img src="{$smarty.const.URL_PRODUCTS_PICTURES}/{$product_item.picture|escape:'url'}" alt="{$product_item.name|escape:'html'}" title="{$product_item.name|escape:'html'}">
	{/if}
					</a>
				</td>
			</tr>
		</table>
		</div>
		{/if}
		</td>
		
		<td>
		<a {$target} href='{$_product_url}'>{$product_item.name|escape:'html'}</a>
		</td>
		
		<td>{* product code (SKU) *}
{if $product_item.product_code && $smarty.const.CONF_ENABLE_PRODUCT_SKU}
		{$product_item.product_code|escape:'html'}
{/if}	</td>

		<td>1шт.</td>{*TODO*}
		
		<td class="price">{$product_item.Price} <span class="rur">p<span>уб.</span></span></td>
		
		<td width="110">
			<form class="product-form" action='{"?ukey=cart`$_form_action_url`"|set_query_html}' method="post" rel="{$product_item.productID}" {if $widget}target="_blank"{/if}>
				{if $product_item.ordering_available && $product_item.Price>0 && ( $smarty.const.CONF_SHOW_ADD2CART eq 1 ) && ( $smarty.const.CONF_CHECKSTOCK==0 || $product_item.in_stock > 0 ) }
					<input name="action" value="add_product" type="hidden">
					<input name="productID" value="{$product_item.productID}" type="hidden">
					<input class="product_price" value="{$product_item.PriceWithOutUnit|escape:'html'}" type="hidden">
					
					<input class="product_qty" name="product_qty" value="0" />

					<div class="add">
						<a href="#" class="plus"></a>
						<a href="#" class="minus"></a>
					</div>				
					
					<div class="prdbrief_add2cart">
						<input  type="submit" value=""  title="Добавить в корзину" {if $smarty.const.CONF_SHOPPING_CART_VIEW ne $smarty.const.SHCART_VIEW_PAGE && !$widget} class="add2cart_handler" rel="{if $widget}widget{/if}" {/if}>
					</div>					
					<div class="clear"></div>
				{elseif $smarty.const.CONF_SHOW_ADD2CART eq 1 && $smarty.const.CONF_CHECKSTOCK && !$product_item.in_stock && $product_item.ordering_available}
					<div class="prd_out_of_stock">{lbl_prd_out_of_stock}</div>
				{else}				
					<i>нет в наличии</i>
				{/if}
			</form>

		</td>
	</tr>
<!-- end tr product block -->
	
	{* if ($smarty.foreach.product_brief.index+1) is div by $smarty.const.CONF_COLUMNS_PER_PAGE}</tr>{elseif $smarty.foreach.product_brief.last}</tr>{/if *}
  {/foreach}
</tbody>	
</table> 
 
{if $catalog_navigator}<p class="pagination">{$catalog_navigator}</p>{/if}

{*
 * @features "Products comparison"
*}
{include file="comparison_products_button.html"}
{*
 * @features
*}

{else}
<p>
	{if $search_with_change_category_ability && !$advanced_search_in_category}
		&nbsp;
	{else}
		{if $advanced_search_in_category}
			&nbsp;&nbsp;&nbsp;&nbsp;< {"srch_no_matches_found"|translate} >
		{else}
			&nbsp;&nbsp;&nbsp;&nbsp;< {"str_empty_category"|translate} >
		{/if}
	{/if}
</p>
{/if}

</center>